package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ee.chat.common.entity.UserFocus;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-10-05
 */
public interface UserFocusMapper extends BaseMapper<UserFocus> {
    UserFocus select(@Param("userId") Integer userId, @Param("focusUserId") Integer focusUserId);

    /**
     * 获取用户关注或粉丝数量
     * @param userId    用户id
     * @param type  类型，0-关注  1-粉丝
     * @param date  指定时间后的数量量
     * @return
     */
    Integer getUserNum(@Param("userId") Integer userId, @Param("type") Integer type, @Param("date") Date date);

    /**
     * 取消关注
     * @param userId
     * @param focusUserId
     * @return
     */
    int cancelFocus(@Param("userId") Integer userId, @Param("FocusUserId") Integer focusUserId);
}